﻿/**********************************************************************
 * @file   BrowserTableHandlerSpectraAbstract.h
 * @brief  频谱表格处理器抽象类声明
 * @author BaGuijun (baguijun@163.com)
 * @date   2024-12-06
 *********************************************************************/
#ifndef BrowserTableHandlerSpectraAbstract_H_
#define BrowserTableHandlerSpectraAbstract_H_

#include "GUIWidgetAPI.h"
#include "WidgetBrowserTable.h"

namespace Acoustics {
    class FITKAcousticsSpectraManager;
    class FITKAcousticsAbstractSpectra;
}

namespace EventOper{
    class OperAbstractSpectra;
}

namespace GUI
{
    /**
     * @brief  频谱表格处理器抽象类
     * @author BaGuijun (baguijun@163.com)
     * @date   2024-12-06
     */
    class GUIWIDGETAPI BrowserTableHandlerSpectraAbstract : public BrowserTableAbstractHandler
    {
        Q_OBJECT;
    public:
        /**
         * @brief 构造函数
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        BrowserTableHandlerSpectraAbstract(WidgetBrowserTable* table);
        /**
         * @brief 析构函数
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        virtual ~BrowserTableHandlerSpectraAbstract() = default;
        /**
         * @brief 右键菜单
         * @param[i]  popMenu        右键菜单
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        virtual void contextMenu(QMenu* popMenu) override;
        /**
         * @brief 表头右键菜单
         * @param[i]  popMenu        右键菜单
         * @param[i]  coluIndex      列索引
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        virtual void headerContextMenu(QMenu* popMenu, int coluIndex) override;
        /**
         * @brief    更新表格
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-06
         */
        virtual void updateTable() override;
    protected:
        /**
         * @brief 获取操作器
         * @return EventOper::OperAbstractMaterial*
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        virtual EventOper::OperAbstractSpectra* getSpectraOper() = 0;
        /**
        * @brief 单元格双击
        * @param[i]  row         行索引
        * @param[i]  colum         列索引
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        virtual void itemDoubleClicked(int row, int colum) override;
        /**
         * @brief    获取频率类型
         * @param[i] spectraData            频谱对象
         * @return   QString                频域类型
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-13
         */
        virtual QString getBandWidth(Acoustics::FITKAcousticsAbstractSpectra* spectraData);
    private slots:
        ;
        /**
         * @brief 编辑频谱
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        void editSpectraSlot();
        /**
         * @brief 新增频谱
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        void createSpectraSlot();
        /**
         * @brief 复制频谱
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        void duplicateSpectraSlot();
        /**
         * @brief 移除频谱
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        void removeSpectraSlot();
        /**
         * @brief 设置属性
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        void setNotesSlot();
    protected:
        /**
         * @brief  频谱管理器
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-06
         */
        Acoustics::FITKAcousticsSpectraManager* _spectraManager = nullptr;
    };
}
#endif